﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XTYAPI.PLC
{
    /// <summary>
    /// 或运算
    /// </summary>
    public class OR
    {
        /// <summary>
        /// 或过程存储
        /// </summary>
        public List<bool> ORs { get; set; } = new List<bool>();
        public bool CalOR()
        {
            if (ORs.Count < 1)
            {
                throw new Exception("至少需要1个bool量进行与预算");
            }
            foreach (var item in ORs)
            {
                if (item)
                {
                    return true;
                }
            }
            return false;
        }
    }
}
